import { useCallback } from 'react'
import { Modal } from 'antd'
import { ExclamationCircleFilled } from '@ant-design/icons'

const useConfirmModal = () => {
  const confirm = useCallback((onOk) => {
    Modal.confirm({
      title: '提示',
      icon: <ExclamationCircleFilled />,
      content: '确定执行此操作吗?',
      okText: '确认',
      okType: 'danger',
      cancelText: '取消',
      centered: true,
      onOk
    })
  }, [])

  return confirm
}

export default useConfirmModal